filetype plugin indent on
set clipboard=unnamed

" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" show line number
set nu
set backspace=indent,eol,start
set hlsearch
set ignorecase
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1

set nobackup       " no backup files
set noswapfile     " no swap files
set nowritebackup  " only in case you don't want a backup file while editing
set noundofile     " no undo files

" regex very magic for search
nnoremap / /\v
vnoremap / /\v
cnoremap %s/ %smagic/
cnoremap >s/ >smagic/ 
nnoremap :g/ :g/\v
nnoremap :g// :g//

syntax on
color dracula
"ios tweak
au BufNewFile,BufRead *.xm,*.xmm,*.l.mm setf logos
"imap jk <Esc>
set guifont=Menlo\ Regular:h14

"大文件高亮
syntax sync minlines=10000
set redrawtime=10000

set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_switch_buffer = 'et'
let g:ctrlp_working_path_mode = ''
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'

"""""""""""""""""""""""""""""""""""""""
"   nerdtree
"""""""""""""""""""""""""""""""""""""""
set runtimepath^=~/.vim/bundle/nerdtree
map <leader>nt :NERDTreeToggle<CR>
"let NERDTreeWinSize=40

let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "✹",
    \ "Staged"    : "✚",
    \ "Untracked" : "✭",
    \ "Renamed"   : "➜",
    \ "Unmerged"  : "═",
    \ "Deleted"   : "✖",
    \ "Dirty"     : "✗",
    \ "Clean"     : "✔︎",
    \ "Unknown"   : "?"
    \ }

set runtimepath^=~/.vim/bundle/vim-nerdtree-tabs
map <Leader>t <plug>NERDTreeTabsToggle<CR>
map <Leader>f <plug>NERDTreeTabsFind<CR>

"""indentLine
set runtimepath^=~/.vim/bundle/indentLine/after
"""surround
set runtimepath^=~/.vim/bundle/surround
""repeat
set runtimepath^=~/.vim/bundle/repeat
"""html5
set runtimepath^=~/.vim/bundle/html5.vim
"""js
set runtimepath^=~/.vim/bundle/vim-javascript
""taglist
set runtimepath^=~/.vim/bundle/taglist
" ctags-tool
source ~/.vim/bundle/ctags-tool/autoload/ctags-tool.vim
source ~/.vim/pack/plugin/start/plugin/tmux_navigator.vim

"fzf
set rtp+=~/.fzf

""""""""
let Tlist_Show_One_File=1    "只显示当前文件的tags
let Tlist_WinWidth=40        "设置taglist宽度
let Tlist_Exit_OnlyWindow=1  "tagList窗口是最后一个窗口，则退出Vim
let Tlist_Use_Right_Window=1 "在Vim窗口右侧显示taglist窗口
let tlist_php_settings='php;f:function'
let tlist_objc_settings = 'ObjectiveC;i:interface;c:class;m:method;p:property'
noremap <F2> :TlistToggle<CR>

"tab
nnoremap <Leader>1 1gt
nnoremap <Leader>2 2gt
nnoremap <Leader>3 3gt
nnoremap <Leader>4 4gt
nnoremap <Leader>5 5gt
nnoremap <Leader>6 6gt
nnoremap <Leader>7 7gt
nnoremap <Leader>9 9gt
noremap <Leader>m :tabnew<cr>
noremap <Leader>e :tabclose<cr>
noremap <Leader>n :tabn<cr>
noremap <Leader>p :tabp<cr>
noremap <Leader>] :tablast<cr>
noremap <Leader>[ :tabfirst<cr>

"自动刷新文件
set autoread
nnoremap <F5> :checktime<CR>

